<template>
  <div id="app">
    <h1>根组件 - {{ title }} - {{ count }}</h1>
    <input type="text">
    <SonOne></SonOne>
    <hr>
    <SonTwo></SonTwo>
  </div>
</template>

<script>
import SonOne from './components/SonOne.vue'
import SonTwo from './components/SonTwo.vue'

import { mapState } from 'vuex'

export default {
  name: 'app',
  data: function () {
    return {

    }
  },
  computed: {
    // 展开映射
    ...mapState(['count', 'title'])
  },
  components: {
    SonOne,
    SonTwo
  }
}
</script>

<style>
#app {
  width: 600px;
  margin: 20px auto;
  border: 3px solid #ccc;
  border-radius: 3px;
  padding: 10px;
}
</style>
